//    Copyright (C) 2013  <lugocreation@gmail.com>
//
//    This program is free software: you can redistribute it and/or modify
//    it under the terms of the GNU General Public License as published by
//    the Free Software Foundation, either version 3 of the License, or
//    (at your option) any later version.
//
//    This program is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//    GNU General Public License for more details.
//
//    You should have received a copy of the GNU General Public License
//    along with this program.  If not, see <http://www.gnu.org/licenses/>.
package org.jpgolay.me.order;

import java.io.Serializable;
import java.math.BigDecimal;

public class OrderRow
        implements Serializable {

    public OrderRow() {
    }

    public OrderRow(Integer id, Integer line, BigDecimal status, String factureId, String venteId, String articleId, String designation,
            Integer tvaId, String lotId, Integer reliquatId, BigDecimal quantite, BigDecimal prixVente, BigDecimal prixUnitaire, BigDecimal totalHt,
            BigDecimal remise, String updateLastTime, String userId, Integer batchId) {
        setId(id);
        setLine(line);
        setStatus(status);
        setFactureId(factureId);
        setVenteId(venteId);
        setArticleId(articleId);
        setDesignation(designation);
        setTvaId(tvaId);
        setLotId(lotId);
        setReliquatId(reliquatId);
        setQuantite(quantite);
        setPrixVente(prixVente);
        setPrixUnitaire(prixUnitaire);
        setTotalHt(totalHt);
        setRemise(remise);
        setUpdateLastTime(updateLastTime);
        setUserId(userId);
        setBatchId(batchId);
    }

    public OrderRow(OrderRow otherData) {
        setId(otherData.getId());
        setLine(otherData.getLine());
        setStatus(otherData.getStatus());
        setFactureId(otherData.getFactureId());
        setVenteId(otherData.getVenteId());
        setArticleId(otherData.getArticleId());
        setDesignation(otherData.getDesignation());
        setTvaId(otherData.getTvaId());
        setLotId(otherData.getLotId());
        setReliquatId(otherData.getReliquatId());
        setQuantite(otherData.getQuantite());
        setPrixVente(otherData.getPrixVente());
        setPrixUnitaire(otherData.getPrixUnitaire());
        setTotalHt(otherData.getTotalHt());
        setRemise(otherData.getRemise());
        setUpdateLastTime(otherData.getUpdateLastTime());
        setUserId(otherData.getUserId());
        setBatchId(otherData.getBatchId());
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getId() {
        return id;
    }

    public Integer getLine() {
        return line;
    }

    public void setLine(Integer line) {
        this.line = line;
    }

    public BigDecimal getStatus() {
        return status;
    }

    public void setStatus(BigDecimal status) {
        this.status = status;
    }

    public void setFactureId(String factureId) {
        this.factureId = factureId;
    }

    public String getFactureId() {
        return factureId;
    }

    public void setVenteId(String venteId) {
        this.venteId = venteId;
    }

    public String getVenteId() {
        return venteId;
    }

    public void setArticleId(String articleId) {
        this.articleId = articleId;
    }

    public String getArticleId() {
        return articleId;
    }

    public void setDesignation(String designation) {
        this.designation = designation;
    }

    public String getDesignation() {
        return designation;
    }

    public void setTvaId(Integer tvaId) {
        this.tvaId = tvaId;
    }

    public Integer getTvaId() {
        return tvaId;
    }

    public void setLotId(String lotId) {
        this.lotId = lotId;
    }

    public String getLotId() {
        return lotId;
    }

    public void setReliquatId(Integer reliquatId) {
        this.reliquatId = reliquatId;
    }

    public Integer getReliquatId() {
        return reliquatId;
    }

    public void setQuantite(BigDecimal quantite) {
        this.quantite = quantite;
    }

    public BigDecimal getQuantite() {
        return quantite;
    }

    public void setPrixVente(BigDecimal prixVente) {
        this.prixVente = prixVente;
    }

    public BigDecimal getPrixVente() {
        return prixVente;
    }

    public void setPrixUnitaire(BigDecimal prixUnitaire) {
        this.prixUnitaire = prixUnitaire;
    }

    public BigDecimal getPrixUnitaire() {
        return prixUnitaire;
    }

    public void setTotalHt(BigDecimal totalHt) {
        this.totalHt = totalHt;
    }

    public BigDecimal getTotalHt() {
        return totalHt;
    }

    public void setRemise(BigDecimal remise) {
        this.remise = remise;
    }

    public BigDecimal getRemise() {
        return remise;
    }

    public String getUpdateLastTime() {
        return updateLastTime;
    }

    public void setUpdateLastTime(String updateLastTime) {
        this.updateLastTime = updateLastTime;
    }

    public String getUserId() {
        return userId;
    }

    public void setUserId(String userId) {
        this.userId = userId;
    }

    public Integer getBatchId() {
        return batchId;
    }

    public void setBatchId(Integer batchId) {
        this.batchId = batchId;
    }

    public String toString() {
        StringBuffer str = new StringBuffer("{");
        str.append("id=" + getId() + " " + "line=" + getLine() + " " + "status=" + getStatus() + " " + "factureId=" + getFactureId() + " " + "venteId=" + getVenteId() + " " + "articleId=" + getArticleId() + " " + "designation=" + getDesignation() + " " + "tvaId=" + getTvaId() + " " + "lotId=" + getLotId() + " " + "reliquatId=" + getReliquatId() + " " + "quantite=" + getQuantite() + " " + "prixVente=" + getPrixVente() + " " + "prixUnitaire=" + getPrixUnitaire() + " " + "totalHt=" + getTotalHt() + " " + "remise=" + getRemise() + " " + "updateLastTime=" + getUpdateLastTime() + " " + "batchId=" + getBatchId() + " " + "userId=" + getUserId());
        str.append('}');
        return str.toString();
    }

    public boolean equals(Object pOther) {
        if (pOther instanceof OrderRow) {
            OrderRow lTest = (OrderRow) pOther;
            boolean lEquals = true;
            if (id == null) {
                lEquals = lEquals && lTest.id == null;
            } else {
                lEquals = lEquals && id.equals(lTest.id);
            }
            if (line == null) {
                lEquals = lEquals && lTest.line == null;
            } else {
                lEquals = lEquals && line.equals(lTest.line);
            }
            if (status == null) {
                lEquals = lEquals && lTest.status == null;
            } else {
                lEquals = lEquals && status.equals(lTest.status);
            }
            if (factureId == null) {
                lEquals = lEquals && lTest.factureId == null;
            } else {
                lEquals = lEquals && factureId.equals(lTest.factureId);
            }
            if (venteId == null) {
                lEquals = lEquals && lTest.venteId == null;
            } else {
                lEquals = lEquals && venteId.equals(lTest.venteId);
            }
            if (articleId == null) {
                lEquals = lEquals && lTest.articleId == null;
            } else {
                lEquals = lEquals && articleId.equals(lTest.articleId);
            }
            if (designation == null) {
                lEquals = lEquals && lTest.designation == null;
            } else {
                lEquals = lEquals && designation.equals(lTest.designation);
            }
            if (tvaId == null) {
                lEquals = lEquals && lTest.tvaId == null;
            } else {
                lEquals = lEquals && tvaId.equals(lTest.tvaId);
            }
            if (lotId == null) {
                lEquals = lEquals && lTest.lotId == null;
            } else {
                lEquals = lEquals && lotId.equals(lTest.lotId);
            }
            if (reliquatId == null) {
                lEquals = lEquals && lTest.reliquatId == null;
            } else {
                lEquals = lEquals && reliquatId.equals(lTest.reliquatId);
            }
            if (quantite == null) {
                lEquals = lEquals && lTest.quantite == null;
            } else {
                lEquals = lEquals && quantite.equals(lTest.quantite);
            }
            if (prixVente == null) {
                lEquals = lEquals && lTest.prixVente == null;
            } else {
                lEquals = lEquals && prixVente.equals(lTest.prixVente);
            }
            if (prixUnitaire == null) {
                lEquals = lEquals && lTest.prixUnitaire == null;
            } else {
                lEquals = lEquals && prixUnitaire.equals(lTest.prixUnitaire);
            }
            if (totalHt == null) {
                lEquals = lEquals && lTest.totalHt == null;
            } else {
                lEquals = lEquals && totalHt.equals(lTest.totalHt);
            }
            if (remise == null) {
                lEquals = lEquals && lTest.remise == null;
            } else {
                lEquals = lEquals && remise.equals(lTest.remise);
            }
            if (updateLastTime == null) {
                lEquals = lEquals && lTest.updateLastTime == null;
            } else {
                lEquals = lEquals && updateLastTime.equals(lTest.updateLastTime);
            }
            if (userId == null) {
                lEquals = lEquals && lTest.userId == null;
            } else {
                lEquals = lEquals && userId.equals(lTest.userId);
            }
            if (batchId == null) {
                lEquals = lEquals && lTest.batchId == null;
            } else {
                lEquals = lEquals && batchId.equals(lTest.batchId);
            }
            return lEquals;
        } else {
            return false;
        }
    }

    public int hashCode() {
        int result = 17;
        result = 37 * result + (id == null ? 0 : id.hashCode());
        result = 37 * result + (line == null ? 0 : line.hashCode());
        result = 37 * result + (status == null ? 0 : status.hashCode());
        result = 37 * result + (factureId == null ? 0 : factureId.hashCode());
        result = 37 * result + (venteId == null ? 0 : venteId.hashCode());
        result = 37 * result + (articleId == null ? 0 : articleId.hashCode());
        result = 37 * result + (designation == null ? 0 : designation.hashCode());
        result = 37 * result + (tvaId == null ? 0 : tvaId.hashCode());
        result = 37 * result + (lotId == null ? 0 : lotId.hashCode());
        result = 37 * result + (reliquatId == null ? 0 : reliquatId.hashCode());
        result = 37 * result + (quantite == null ? 0 : quantite.hashCode());
        result = 37 * result + (prixVente == null ? 0 : prixVente.hashCode());
        result = 37 * result + (prixUnitaire == null ? 0 : prixUnitaire.hashCode());
        result = 37 * result + (totalHt == null ? 0 : totalHt.hashCode());
        result = 37 * result + (remise == null ? 0 : remise.hashCode());
        result = 37 * result + (updateLastTime == null ? 0 : updateLastTime.hashCode());
        result = 37 * result + (userId == null ? 0 : userId.hashCode());
        result = 37 * result + (batchId == null ? 0 : batchId.hashCode());
        return result;
    }
    private Integer id;
    private Integer line;
    private BigDecimal status;
    private String factureId;
    private String venteId;
    private String articleId;
    private String designation;
    private Integer tvaId;
    private String lotId;
    private Integer reliquatId;
    private BigDecimal quantite;
    private BigDecimal prixVente;
    private BigDecimal prixUnitaire;
    private BigDecimal totalHt;
    private BigDecimal remise;
    private String updateLastTime;
    private String userId;
    private Integer batchId;
}
